package com.level2app.ui.welcome;


import android.graphics.Paint;
import android.os.Bundle;

import com.level2app.base.BaseActivity;
import com.level2app.base.BaseViewModel;
import com.level2app.databinding.ActivityWelcomeBinding;
import com.level2app.ui.login.EmailLoginActivity;
import com.level2app.utils.JumpIntent;

/**
 * 欢迎页1
 */
public class WelcomeActivity extends BaseActivity<ActivityWelcomeBinding, BaseViewModel> {

    @Override
    protected BaseViewModel bindModel() {
        return getViewModel(this, BaseViewModel.class);
    }

    @Override
    protected void initInject() {
        getActivityComponent().inject(this);
    }

    @Override
    protected void initData() {
        binding.tvLogin.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);
        binding.tvLogin.getPaint().setAntiAlias(true);//抗锯齿

    }

    @Override
    protected void initClick() {
        super.initClick();
        viewModel.onDelayClick(binding.tvLogin, o -> {
            //去登录
            Bundle bundle = new Bundle();
            bundle.putInt("source", 0);
            JumpIntent.jump(this, EmailLoginActivity.class, bundle);
        });
        viewModel.onDelayClick(binding.getStartBtn, o -> {
            //下一步
            JumpIntent.jump(this, WelcomeScanQRActivity.class);
        });

    }
}